package com.hospital;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@SpringBootApplication(scanBasePackages = "com.hospital")  // 核心注解：启用自动配置+组件扫描
public class HospitalApp {

    public static void main(String[] args) {
        // 启动嵌入式Tomcat并初始化Spring容器
        SpringApplication.run(HospitalApp.class, args);
    }

    // 可选：快速测试接口（作业演示用）
    @RestController
    public static class TestController {
        @GetMapping("/ping")
        public String ping() {
            return "Hospital System is running!";
        }
    }

}